package model.core;

import model.entity.Entity;
import utility.BidirectionalMap;

public class EntityLibrary {
	private BidirectionalMap<String, Entity> library = new BidirectionalMap<String, Entity>();
	
	private static EntityLibrary npcLibrary = null;
	
	private EntityLibrary(){
		
	}
	
	public static EntityLibrary getInstance(){
		if (npcLibrary == null){
			npcLibrary = new EntityLibrary();
		}
		return npcLibrary;
	}
	
	public Entity getEntity(String name){
		return library.getFromSecondSet(name);
	}
	
	public String getName(Entity n){
		return library.getFromFirstSet(n);
	}
	
	public void put(String name, Entity n){
		library.put(name, n);
	}
}
